<?php 
//Project Controller
include_once("../service/ServiceLog.php");
include_once("Controller.php");
class ControllerLog extends Controller implements IController 
{
  public function __construct()
  {    
    $this->strproid = !isset($_GET['strproid'])?"":$_GET['strproid'];
    $this->service = new ServiceLog();
  }
  private function checkProid()
  {
    if($this->strproid=="")
    return false;
    return true;
  }
  public function addRec()
  {
    $log = !isset($_POST['l'])?"":$_POST['l'];
    echo ($this->service->create($log));
  }
  public function delRec()
  {
    
  }
  public function updateRec()
  {
    
  }
  public function query()
  {
   echo $this->service->queryMenu(); 
  }
  /**
   *get summary
   */
  public function sum()
  {
    echo $this->service->getSum();
  }
  public function details()
  {
    echo $this->service->getDetails();
  }
  public function detail()
  {
    $logId = !isset($_GET['intdid'])?-1:$_GET['intdid'];
    echo $this->service->getDetail($logId);
  }
  /**
   *get the top 10 record
   */
  public function recent()
  {
    echo $this->service->queryMenu();
  }
}
 ?>